@model ShivamEMR.Model.Domain.PharmacyDomain.DrugItem

@* This partial view defines form fields that will appear when creating and editing entities *@

<div class="editor-label">
    @Html.LabelFor(model => model.Code)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Code)
    @Html.ValidationMessageFor(model => model.Code)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Name)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Name)
    @Html.ValidationMessageFor(model => model.Name)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Description)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Description)
    @Html.ValidationMessageFor(model => model.Description)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Balance)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Balance)
    @Html.ValidationMessageFor(model => model.Balance)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Notes)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Notes)
    @Html.ValidationMessageFor(model => model.Notes)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.Barcode)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.Barcode)
    @Html.ValidationMessageFor(model => model.Barcode)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.DrugItemCode)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.DrugItemCode)
    @Html.ValidationMessageFor(model => model.DrugItemCode)
</div>

<div class="editor-label">
    @Html.LabelFor(model => model.DrugItemNotes)
</div>
<div class="editor-field">
    @Html.EditorFor(model => model.DrugItemNotes)
    @Html.ValidationMessageFor(model => model.DrugItemNotes)
</div>

<div class="editor-label">
    ItemType
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.ItemTypeID, ((IEnumerable<ShivamEMR.Model.Domain.InventoryDomain.ItemType>)ViewBag.PossibleItemTypes).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.ItemTypeID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.ItemTypeID)
</div>
<div class="editor-label">
    ItemGroup
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.ItemGroupID, ((IEnumerable<ShivamEMR.Model.Domain.InventoryDomain.ItemGroup>)ViewBag.PossibleItemGroups).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.ItemGroupID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.ItemGroupID)
</div>
<div class="editor-label">
    Manufacturer
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.ManufacturerID, ((IEnumerable<ShivamEMR.Model.Domain.InventoryDomain.Manufacturer>)ViewBag.PossibleManufacturers).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Name), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.ManufacturerID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.ManufacturerID)
</div>
<div class="editor-label">
    Picture
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.PictureID, ((IEnumerable<ShivamEMR.Model.Domain.InventoryDomain.ItemPicture>)ViewBag.PossiblePictures).Select(option => new SelectListItem {
        Text = (option == null ? "None" : option.Title), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.PictureID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.PictureID)
</div>
<div class="editor-label">
    ItemStatus
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.ItemStatusID, ((IEnumerable<ShivamEMR.Model.Domain.InventoryDomain.ItemStatus>)ViewBag.PossibleItemStatus).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.ItemStatusID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.ItemStatusID)
</div>
<div class="editor-label">
    Drug
</div>
<div class="editor-field">
    @Html.DropDownListFor(model => model.DrugID, ((IEnumerable<ShivamEMR.Model.Domain.PharmacyDomain.Drug>)ViewBag.PossibleDrugs).Select(option => new SelectListItem {
        Text = Html.DisplayTextFor(_ => option).ToString(), 
        Value = option.ID.ToString(),
        Selected = (Model != null) && (option.ID == Model.DrugID)
    }), "Choose...")
    @Html.ValidationMessageFor(model => model.DrugID)
</div>
